{extend name="layout:base" /}
{block name="page_style"}
    <link rel="stylesheet" href="{$site_root}/static/plugins/simditor2.3.15/styles/simditor.css" />
{/block}
{block name="page_content"}
<section class="apply-details">
    <div class="center">
        <div class="top">
            <img src="{$site_root}{$article.pc_cover_path}" alt="{$vo.title}">
            <div class="details">
                <div class="title">{$article.title}</div>
                <div class="organizer" title="{$article.host}">主办：{$article.host}</div>
                <div class="address" title="{$article.address}">地点：{$article.address}</div>
                <div class="time">时间：{$article.start_date} - {$article.end_date}</div>
                <div class="money">费用：{$article.unit_price}</div>
                <div class="do">
                    <?php if($article['status'] == true && $article['sub_state'] == 'processed'): ?>
                        <button class="join sub-column">
                            报名参加
                        </button>
                    <?php else: ?>
                        <button class="join disabled">
                            报名参加
                        </button>
                    <?php endif; ?>
                    <?php if(!empty($article['attachment_path'])): ?>
                        <button class="downland">
                            <a href="{$article.attachment_path}" target="_blank">
                                <i class="icon icon-downland-tit"></i>
                                <i class="icon icon-downland"></i>资料下载
                            </a>
                        </button>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <p>培训内容</p>
        <div class="content simditor" style="border:0px;">
            <div class="simditor-body">
                {$article.content|raw}
            </div>
        </div>
    </div>
</section>
{/block}
{block name="page_pop"}
    <!--报名弹窗-->
    <div class="pop join-pop" data-url="{:url('sub', ['id' => $article['id']])}"
     data-name="joinPopMsg">
        <i class="icon icon-close"></i>
        <div class="title">
            报名信息
        </div>
        <div class="content">
            <div class="form-item must" data-name="user_name">
                <div class="form-left" style="display: none;">姓名</div>
                <div class="form-right">
                    <input type="text" name="user_name" placeholder="输入姓名">
                </div>
            </div>
            <div class="form-item must" data-name="mobile">
                <div class="form-left" style="display: none;">手机号</div>
                <div class="form-right">
                    <input type="text" name="mobile" placeholder="输入手机号">
                </div>
            </div>
        </div>
        <div class="controls">
            <button class="sure">提交</button>
        </div>
    </div>
{/block}
{block name="page_js"}
<script type="text/javascript">
    let joinPopMsg = {user_name: '', mobile: ''};
    $(document).ready(function(){
        $(".sub-column").on('click', function(){
            showPop('join-pop');
            return false;
        });
        $(".downland").on('click', function(){
            var $href = $(this).find('a');
            if($href.length){
                $href[0].click();
            }
        })
    });
</script>
{/block}